﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDF.Data;
using System.Data;
using DDF.Data.Providers;

namespace ARR.DataModel.Repositories
{
    public static partial class StoresRepository
    {
        public static void UpdateFromTempStores(int countryId)
        {
            using (Database database = new SqlDataProvider(connString, "{0}Cursor", "dbo"))
            {
                database.NewCommand("Stores_UpdateFromTempStores", CommandType.StoredProcedure);
                database.AddInParameter("@CountryId", DbType.Int16, countryId);

                database.ExecuteNonQuery();
            }
        }

        public static void InsertFromTempStores(int countryId, int rangeReviewId)
        {
            using (Database database = new SqlDataProvider(connString, "{0}Cursor", "dbo"))
            {
                database.NewCommand("Stores_InsertFromTempStores", CommandType.StoredProcedure);
                database.AddInParameter("@CountryId", DbType.Int16, countryId);
                database.AddInParameter("@RangeReviewId", DbType.Int32, rangeReviewId);

                database.ExecuteNonQuery();
            }
        }
    }
}
